
    <h1><?php echo $data['Institution']['institution_abbr']." ".$data['Course']['course']." ".$data['Semester']['semester']." ".$data['Offering']['year']." - ".$data['Course']['course_title']; ?></h1>
    <div id="left"> 
      <div class="info"> 
        <h2>Course Offering Details <a href="#"><?php echo $html->image('icons/table_edit.png', array('alt' => 'Edit'))?></a></h2>
        
        <table>
        	<tr>
        		<td>Development Term:</td>
        		<td><?php echo $data['DevSemester']['semester']." ".$data['Offering']['dev_year']; ?></td>
        	</tr>
        	<tr>
        		<td>Offering Type:</td>
        		<td><?php echo $data['OfferingType']['offering_type']; ?></td>
        	</tr>
        	<tr>
        		<td>Sections:</td>
        		<td><?php echo $data['Offering']['multiple_sections']; ?></td>
        	</tr>
        	<tr>
        		<td>Release Date:</td>
        		<td>
        		<?php 
        			$month = $time->format('m',$data['Offering']['start_date']);
        			$day = $time->format('d',$data['Offering']['start_date']);
        			$year = $time->format('Y',$data['Offering']['start_date']);
        			$day = $day - 7; 
        			echo date("l, F j, Y",mktime(0,0,0,$month,$day,$year));
        		?>
        		</td>
        	</tr>
        	<tr>
        		<td>Start Date:</td>
        		<td><?php if ($data['Offering']['start_date']!='0000-00-00') {  echo $time->format("l, F j, Y", $data['Offering']['start_date']); }?></td>
        	</tr>
        	<tr>
        		<td>End Date:</td>
        		<td><?php  if ($data['Offering']['end_date']!='0000-00-00') {  echo $time->format("l, F j, Y", $data['Offering']['end_date']); }?></td>
        	</tr>
        	<tr>
        		<td>Closing Date:</td>
        		<td>
        		<?php
        			$month = $time->format('m',$data['Offering']['start_date']);
        			$day = $time->format('d',$data['Offering']['start_date']);
        			$year = $time->format('Y',$data['Offering']['start_date']);
        			$month = $month + 1; 
        			echo date("l, F j, Y",mktime(0,0,0,$month,$day,$year));
        		?>
        		</td>
        	</tr>
        	<tr>
        		<td>Is Active:</td>
        		<td><?php if($data['Offering']['offering_active']==1) { echo "Yes"; } else { echo "No"; } ?></td>
        	</tr>
        	<tr>
        		<td>Catalog Received:</td>
        		<td><?php if ($data['Offering']['catalog_received']!='0000-00-00') {  echo $time->format("l, F j, Y", $data['Offering']['catalog_received']); }?></td>
        	</tr>
        	<tr>
        		<td>Completed:</td>
        		<td></td>
        	</tr>
        </table>
      </div>
      <div class="info"> 
        <h2>Course Offering Status</h2>
        <?php if(count($data['Task'])>0): ?>
      	<?php foreach ($data['Task'] as $task): ?>
			<div class="task">
			<h3><?php echo $task['TaskType']['task_type']; ?></h3>
				<div class="status_<?php echo $data['Status']['percent']; ?>"><?php echo $data['Status']['percent']."% ".$data['Status']['status']; ?></div>
			</div>
		<?php endforeach; ?>
        <?php endif; ?>
        <div id="overall_status"> 
          <h3>Overall</h3>
          <div class="status_<?php echo $data['Status']['percent']; ?>"><?php echo $data['Status']['percent']."% ".$data['Status']['status']; ?></div>
        </div>
      </div>
      <div class="info"> 
        <h2>User Enrollment <?php echo $html->image('icons/user_add.png', array('alt' => 'Add User'))?></h2>
        
        <?php if(count($data['Enrollment'])>0): ?>
        
        <table id="enrollment" summary="User Enrollment">
        <?php echo $html->tableHeaders(array('','User','Role','Section',''));?>
		 
          <tbody>
			<?php foreach ($data['Enrollment'] as $enrollment): ?>
			     <?php echo $html->tableCells(array($html->image($enrollment['Role']['icon'], array('alt' => 'Role Icon')),
			     $enrollment['Person']['first_name']." ".$enrollment['Person']['last_name'],
			     $enrollment['Person']['LmsRole']['lms_role'],$enrollment['course_section'], 
			     $html->image('icons/user_edit.png', array('alt' => 'Edit Enrollment'))." ".$html->image('icons/user_delete.png', array('alt' => 'Unenroll'))),
			     array('class'=>'odd')); ?>
			<?php endforeach; ?>
            <tr> 
              <td colspan="5"><?php echo $html->image('icons/user.png', array('alt' => 'Course Developer Icon'))?>=Course Developer 
                <?php echo $html->image('icons/asterisk_orange.png', array('alt' => 'Course Instructor Icon'))?>=Course Instructor</td>
            </tr>
          </tbody>
        </table>
        
        <?php else: ?>
        	<p style="padding-left: 10px;">No users enrolled!</p>
        <?php endif; ?>
        <h2>Enrollment Scripts</h2>
        <p style="padding-left: 10px;">Enroll | Unenroll</p>
      </div>
    </div>
    <div id="right"> 
      <div class="info"> 
        <h2><a href="#" onclick="Effect.toggle('log_events', 'blind');  return false;" title="Show/Hide Comments">Offering Events 
          <?php echo $html->image('icons/control_down_blue.png', array('alt' => 'Show/Hide Log'))?></a></h2>
        <div id="log_events" style="display:none;"> 
        <?php if(count($data['OfferingLog'])>0): ?>
        <?php foreach ($data['OfferingLog'] as $log): ?>
          <div class="log_event"><?php echo $log['EventType']['event_type']." ".$time->relativeTime($log['created'],'m/d/Y')." by ".$log['Person']['last_name']; ?></div>
        <?php endforeach; ?>
        <?php else: ?>
        	<p style="padding-left: 10px;">No log events recorded.</p>
        <?php endif; ?>
        </div>
      </div>
      <div class="info"> 
        <h2>Comment History <a href="#"><?php echo $html->image('icons/feed.png', array('alt' => 'RSS Feed'))?></a> 
          <a href="#"><?php echo $html->image('icons/comment_add.png', array('alt' => 'Add Comment'))?></a></h2>
        <?php if(count($data['OfferingComment'])>0): ?>  
        <?php foreach ($data['OfferingComment'] as $comment): ?>
        <div class="comment"> 
          <div class="comment_header"> 
            <h3></h3>
            <a href="#"><?php echo $html->image('icons/comment_delete.png', array('alt' => 'Delete Comment'))?></a> <?php if($comment['course_support']==1) { echo $html->image('icons/help.png', array('alt' => 'Course Support Related')); }?> 
          </div>
          <div class="comment_text"> 
            <?php echo $comment['comment']; ?>
          </div>
          <div class="comment_footer"> <?php echo $comment['Person']['first_name']." ".$comment['Person']['last_name']." (".$comment['Person']['Role']['role'].") ".$time->relativeTime($comment['created'],'m/d/Y'); ?></div>
        </div>
        <?php endforeach; ?>
        <?php else: ?>
        	<p style="padding-left: 10px;">No comments available.</p>
        <?php endif; ?>
      </div>
    </div>
  </div>


</div>

</div>